#usr/bin/python
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'cluster_gui.ui'
#
# Created: Tue Jun 22 14:38:32 2010
#	  by: PyQt4 UI code generator 4.7.2
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

class clusterWidget(QtGui.QDialog):
	def __init__(self, parent = None):
		QtGui.QDialog.__init__(self, parent)
		self.setupUi()
		
	def setupUi(self):
		
		self.setWindowFlags(QtCore.Qt.Window)
		self.resize(387, 100)
		self.verticalLayout = QtGui.QVBoxLayout(self)
		
		
		gb = QtGui.QGroupBox("Files options", self)
		vl = QtGui.QVBoxLayout()
		self.pushButton = QtGui.QPushButton(self)
		self.pushButton.setMaximumSize(QtCore.QSize(200, 16777215))
		vl.addWidget(self.pushButton)
		self.label = QtGui.QLabel(self)
		vl.addWidget(self.label)
		self.lineEdit = QtGui.QLineEdit(self)
		vl.addWidget(self.lineEdit)
		self.pushButton_2 = QtGui.QPushButton(self)
		self.pushButton_2.setMaximumSize(QtCore.QSize(50, 16777215))
		vl.addWidget(self.pushButton_2)
		gb.setLayout(vl)
		self.verticalLayout.addWidget(gb)
		
		spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
		self.verticalLayout.addItem(spacerItem)
		
		gb_2 = QtGui.QGroupBox("Algorithms parameters", self)
		self.gridLayout = QtGui.QGridLayout()
		self.label_2 = QtGui.QLabel(self)
		self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
		self.lineEdit_2 = QtGui.QLineEdit(self)
		self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)
		self.label_3 = QtGui.QLabel(self)
		self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
		self.lineEdit_3 = QtGui.QLineEdit(self)
		self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1)
		self.label_4 = QtGui.QLabel(self)
		self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
		self.lineEdit_4 = QtGui.QLineEdit(self)
		self.gridLayout.addWidget(self.lineEdit_4, 3, 1, 1, 1)
		self.checkBox = QtGui.QCheckBox(self)
		self.gridLayout.addWidget(self.checkBox, 4, 0, 1, 1)
		self.label_5 = QtGui.QLabel(self)
		self.gridLayout.addWidget(self.label_5, 5, 0, 1, 1)
		self.lineEdit_5 = QtGui.QLineEdit(self)
		self.gridLayout.addWidget(self.lineEdit_5, 5, 1, 1, 1)
		self.radioButton = QtGui.QRadioButton(self)
		self.gridLayout.addWidget(self.radioButton, 0, 0, 1, 1)
		self.radioButton_2 = QtGui.QRadioButton(self)
		self.gridLayout.addWidget(self.radioButton_2, 0, 1, 1, 1)
		gb_2.setLayout(self.gridLayout)
		self.verticalLayout.addWidget(gb_2)
		
		self.buttonBox = QtGui.QDialogButtonBox(self)
		self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
		self.verticalLayout.addWidget(self.buttonBox)
		self.retranslateUi()

	def retranslateUi(self):
		self.setWindowTitle(QtGui.QApplication.translate("Dialog", "Clustering Parameters", None, QtGui.QApplication.UnicodeUTF8))
		self.pushButton.setText(QtGui.QApplication.translate("Dialog", "Get Visualized files", None, QtGui.QApplication.UnicodeUTF8))
		self.label.setText(QtGui.QApplication.translate("Dialog", "Filename :", None, QtGui.QApplication.UnicodeUTF8))
		self.pushButton_2.setText(QtGui.QApplication.translate("Dialog", "...", None, QtGui.QApplication.UnicodeUTF8))
		self.label_2.setText(QtGui.QApplication.translate("Dialog", "RT error :", None, QtGui.QApplication.UnicodeUTF8))
		self.label_3.setText(QtGui.QApplication.translate("Dialog", "isotopic length :", None, QtGui.QApplication.UnicodeUTF8))
		self.label_4.setText(QtGui.QApplication.translate("Dialog", "idms length :", None, QtGui.QApplication.UnicodeUTF8))
		self.checkBox.setText(QtGui.QApplication.translate("Dialog", "use correlations (validation)", None, QtGui.QApplication.UnicodeUTF8))
		self.label_5.setText(QtGui.QApplication.translate("Dialog", "correlation value :", None, QtGui.QApplication.UnicodeUTF8))
		self.radioButton.setText(QtGui.QApplication.translate("Dialog", "M0 algorithm", None, QtGui.QApplication.UnicodeUTF8))
		self.radioButton_2.setText(QtGui.QApplication.translate("Dialog", "CAMERA algorithm", None, QtGui.QApplication.UnicodeUTF8))

	def initialize(self):
		self.lineEdit_2.setText("6")
		self.lineEdit_3.setText("6")
		self.lineEdit_4.setText("6")
		self.radioButton_2.setChecked(True)
		self.checkBox.setChecked(True)
		self.lineEdit_5.setText("0.75")
	
	def message(self):
		QtGui.QMessageBox.information(self.parent(), "Done", "Clustering Done !", 0)

	def printing(self,lspl):
		line=""
		for index, filename in enumerate (lspl.getFiles()):
			if not index: 
				line += filename
			else :
				line += ";" +filename
		if self.lineEdit.text() == "":
			self.lineEdit.setText( line )
		else:
			self.lineEdit.setText(self.widget.lineEdit.text() + ", " + line)
